<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
        $tin=  new Model_Tin;
        $all=$tin->getAll();
        $this->view->all=$all;
    }

    public function indexAction()
    {
        // action body
        $tin=  new Model_Tin();
        $idtl=  $this->_request->getParam("idtl"); 
        $idlt=  $this->_request->getParam("idlt");
        if ($idlt!=''&&$idtl!='') {
            $all=$tin->getWhereloaitin($idtl, $idlt);
            $this->view->all=$all;
        }  elseif($idtl!='') {
            $all=$tin->getWheretheloai($idtl);
            $this->view->all=$all;
        }  else {
            $all=$tin->getAll();
            $this->view->all=$all;
        }
    }

    public function viewnewsAction()
    {
        // action body
        $view = new Model_Tin;
        $all = $view->getWhere($this->_request->getParam("idtin"));
        $this->view->all = $all;
    }


}









